import './TodoList.css';
import TodoHeader from './TodoHeader/TodoHeader';
import TodoMain from './TodoMain/TodoMain';
import TodoFooter from './TodoFooter';
import { useEffect } from 'react';
import store from '../../redux/store';
import { asyncGetTodo } from '../../redux/reducers/todoReducer';

let TodoList = () => {
	//派发任务获取任务列表
	useEffect(() => {
		store.dispatch(asyncGetTodo());
	}, []);
	//返回虚拟 DOM 对象 
	return <div className="todo-container">
		<div className="todo-wrap">
			<TodoHeader />
			<TodoMain />
			<TodoFooter />
		</div>
	</div>
}

//暴露
export default TodoList;